#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void fact(int n) //4321  432  43 4
{
	int m = 0;
		m = n % 10;//1 2  3  4
		n = n / 10;//432   43  4 
		if (n > 0)
		{
			fact(n);//
		}
		printf("%d ", m);
}
int main()
{
	int n;
	scanf("%d", &n);
	fact(n);
	return 0;
}